import UIKit
import Combine

class AP_Combine_Demo1VC: UIViewController {
    
    private var cancellables: Set<AnyCancellable> = []

    override func viewDidLoad() {
        super.viewDidLoad()
        
        view.backgroundColor = .white
        setupCombineExample()
    }
    
    private func setupCombineExample() {
        let publisher = Just("Hello, Combine Demo 1!")
        
        publisher
            .sink { [weak self] value in
                self?.handleValue(value)
            }
            .store(in: &cancellables)
    }
    
    private func handleValue(_ value: String) {
        print(value) // 这里可以更新UI或处理数据
    }
} 